package com.chj.comp.common.auth.controller;

import com.chj.comp.common.auth.security.config.WebSecurityConfig;
import com.chj.comp.common.core.constant.CommonConstant;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author ：cuihui
 * @date ：Created in 2023/3/30
 * @description：重写登录页面
 * @modified By：
 */
@Controller
public class AuthLoginController {

    /**
     * 自定义登录页面
     * 需在{@link WebSecurityConfig#configure(HttpSecurity)}中配置
     * @return
     */
    @GetMapping("/oauth/login")
    public ModelAndView loginPage(){
        ModelAndView model = new ModelAndView();
        model.addObject("loginProcessUrl", CommonConstant.AUTH_URI + CommonConstant.LOGIN_URI);
        model.setViewName("base-login");
        return model;
    }
}
